@import "./_constants.pcss";

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  vertical-align: baseline;
}

body {
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', SimSun, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  background-color: $bg-color;
}

a {
  color: #4078c0;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

code[class*="language-"] {
  line-height: 1.5;
  font-family: Menlo, Monaco, Consolas, Courier, monospace;
  font-size: 12px;
  display: block;
  background-color: $code-bg-color;
  padding: 20px;
  -webkit-font-smoothing: auto;
  overflow-x: auto;
}

.clearfix {
  &::before {
    display: table;
    content: "";
  }

  &::after {
    display: table;
    content: "";
    clear: both;
  }
}

.main-content {
  margin: $top-height 20px 40px;
  padding-top: 20px;
}

.page-container {
  background-color: #fff;
  position: relative;
  display: flex;
  width: 100%;
  overflow: hidden;
}

.page-content {
  box-sizing: border-box;
  flex: 1;

  section {
    padding: 0 40px;

    > h1,
    > h2,
    > h3,
    > h4,
    > h5,
    > h6 {
      color: #333;
      line-height: 1.5;
      margin: 20px 0;
      font-weight: normal;
      position: relative;

      &:hover a:first-child {
        opacity: 0.4;
      }

      a:first-child {
        float: left;
        margin-left: -20px;
        opacity: 0;
        cursor: pointer;
      }
    }

    > h1 {
      font-size: 40px;
    }

    > h2 {
      font-size: 36px;
    }

    > h3 {
      font-size: 30px;
    }

    > h4 {
      font-size: 24px;
    }

    > h5 {
      font-size: 14px;
    }

    > h6 {
      font-size: 14px;
      color: #666;
    }

    > p {
      font-size: 14px;
      line-height: 20px;
      color: #666;
      margin: 14px 0;
    }

    > ul li,
    > ol li {
      color: #666;
      font-size: 14px;
      line-height: 20px;
      margin: 10px 0 10px 20px;
      padding-left: 20px;
      position: relative;

      &::before {
        content: '';
        position: absolute;
        width: 8px;
        height: 8px;
        box-sizing: border-box;
        border: 2px solid #999;
        border-radius: 50%;
        top: 6px;
        left: 0;
      }

      li {
        margin-left: 0;
      }
    }

    .anchor-point {
      visibility: hidden;
      position: absolute;
      top: calc(-1 * $top-height - 5px);
    }
  }

  p > code,
  .table code,
  li > code {
    background-color: $code-bg-color;
    display: inline-block;
    border: 1px solid $border-color;
    border-radius: 2px;
    line-height: 1;
    padding: 4px 5px;
    color: #333;
    margin: 0 3px;
  }
}

.table {
  border-collapse: collapse;
  width: 100%;
  background-color: #fff;
  color: #333;
  font-size: 14px;
  margin-bottom: 45px;

  th {
    text-align: left;
    border: 1px solid $border-color;
    background-color: $code-bg-color;
    padding: 10px;

    &:first-child {
      padding-left: 10px;
    }
  }

  td {
    border: 1px solid $border-color;
    padding: 10px;
  }
}
